#import <appkit/appkit.h>
#import "GACUPSListener.h"
#import <mach/mach.h>
#import <mach/message.h>
#import <servers/netname.h>
extern port_t name_server_port;
extern id NXResponsibleDelegate();
@implementation  GACUPSListener :Listener
{}
static NXRemoteMethod *remoteMethods = NULL;
#define REMOTEMETHODS 1
+ initialize 
/* */
{
    if (!remoteMethods) {
	remoteMethods =
	(NXRemoteMethod *) malloc((REMOTEMETHODS+1)*sizeof(NXRemoteMethod));
	remoteMethods[0].key = 
	@selector(systemMode:inverterStatus:alarmStatus:ACInputVolts:ACOutputVolts:ACOutputDeciAmperes:ACLoadVA:batteryDeciVolts:deciHertz:minutes:ambientTemp:ROMVersion:time:);
	remoteMethods[0].types = "IIIIIIIIIIIII";
	remoteMethods[REMOTEMETHODS].key = NULL;
    }
    return self;
}
-(int)systemMode : (int *) systemMode
	inverterStatus : (int *) inverterStatus
	alarmStatus : (int *) alarmStatus
	ACInputVolts : (int *) ACInputVolts
	ACOutputVolts : (int *) ACOutputVolts
	ACOutputDeciAmperes : (int *) ACOutputDeciAmperes
	ACLoadVA : (int *) ACLoadVA
	batteryDeciVolts : (int *) batteryDeciVolts
	deciHertz : (int *) deciHertz
	minutes : (int *) minutes
	ambientTemp : (int *) ambientTemp
	ROMVersion : (int *) ROMVersion
	time : (int *) time
/* */
{
    id _NXd;
    if (_NXd = NXResponsibleDelegate(self,
	@selector(systemMode:inverterStatus:alarmStatus:ACInputVolts:ACOutputVolts:ACOutputDeciAmperes:ACLoadVA:batteryDeciVolts:deciHertz:minutes:ambientTemp:ROMVersion:time:)))
	return [_NXd systemMode : systemMode
		inverterStatus : inverterStatus
		alarmStatus : alarmStatus
		ACInputVolts : ACInputVolts
		ACOutputVolts : ACOutputVolts
		ACOutputDeciAmperes : ACOutputDeciAmperes
		ACLoadVA : ACLoadVA
		batteryDeciVolts : batteryDeciVolts
		deciHertz : deciHertz
		minutes : minutes
		ambientTemp : ambientTemp
		ROMVersion : ROMVersion
		time : time];
    return -1;
}

- (int) performRemoteMethod : (NXRemoteMethod *) method
                  paramList : (NXParamValue *) paramList {
/* */
    switch (method - remoteMethods) {
    case 0:
	return [self systemMode : &paramList[0].ival
		inverterStatus : &paramList[1].ival
		alarmStatus : &paramList[2].ival
		ACInputVolts : &paramList[3].ival
		ACOutputVolts : &paramList[4].ival
		ACOutputDeciAmperes : &paramList[5].ival
		ACLoadVA : &paramList[6].ival
		batteryDeciVolts : &paramList[7].ival
		deciHertz : &paramList[8].ival
		minutes : &paramList[9].ival
		ambientTemp : &paramList[10].ival
		ROMVersion : &paramList[11].ival
		time : &paramList[12].ival];
    default:
	return [super performRemoteMethod : method paramList : paramList];
    }
}
- (NXRemoteMethod *) remoteMethodFor: (SEL) aSel {
/* */
    NXRemoteMethod *rm;
    if (rm = NXRemoteMethodFromSel(aSel,remoteMethods))
        return rm;
    return [super remoteMethodFor : aSel];
}
@end
